﻿namespace ClassRoom.ViewModels
{
    using System;
    using System.ComponentModel;
    using System.Windows;

    /// <summary>
    /// A base class for all viewmodel
    /// 2011.03.11
    /// </summary>
    public class ViewModelBase : DependencyObject, INotifyPropertyChanged
    {
        #region Fields
        #endregion

        #region Events

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        #region Properties
        #endregion Properties

        #region Methods

        protected void RaisePropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        protected virtual bool Validate()
        {
            return true;
        }
        #endregion
    }
}
